package HomeworkZoo;

public abstract class Animal {
    protected String name;

    public Animal() {
    }

    public Animal(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    //抽象方法，只规定子类该有的功能，不能写具体内容
    protected abstract void shout();
    public void eat(Food food){
        System.out.print(this.name+"正在吃着"+food.getName());
    }

}
